package Code.InnerClass.Anonymity;

public class Test2 {
    public static void main(String[] args) {
        //整体可以理解成swim接口二的实现类对象
        Swim swim = new Swim(){
            @Override
            public void swimming() {
                System.out.println("重写方法");
            }
        };

        swim.swimming();

        new Swim(){
            @Override
            public void swimming() {
                System.out.println("重写方法");
            }
        }.swimming();
    }
}
